// MyExecRefsLib.cpp
// This is for testing Static Math Library
// compile with: /EHsc /link MathFuncsLib.lib

#include <iostream>
#include "VectorsLib.h"
#include "MatricesLib.h"

using namespace std;

int main()
{
	/*
	float **matrix1;
	float **matrix2;
	float **matrix3;
	float *vector1;
	float *vector2;
	float *vector3;
	int r1,c1,r2,c2,r3,c3; 
	*/

	////////////////////////////////////////////////////////////////////////////////
	//VECTOR TEST
	////////////////////////////////////////////////////////////////////////////////
	

	/* Read the first Vector
	*/
	/*
	Vectors::MyVectors *v1 = new Vectors::MyVectors();
	vector1 = v1 -> ReadVector();
	int n1 = v1 -> GetNumber();
	cout<<"Vector: ";
	for(int i = 0; i < n1; i++)
	{
		cout<<vector1[i]<<" ";
	} 
	cout<<endl;
	*/

	/* Normalize the vector
	*/
	/*
	if(n1 == 2)
	{
		vector3 = v1 -> NormalizeVector(vector1, 2);
		cout<< "The normalized vector: "<< vector3[0]<<" "<< vector3[1] <<endl;
	}
	if(n1 == 3)
	{
		vector3 = v1 -> NormalizeVector(vector1, 3);
		cout<< "The normalized vector: "<< vector3[0]<< " " <<vector3[1]<<" "<<vector3[2] <<endl;
	}
	*/
	

	/* Calculate the magnitude
	*/
	/*
	if(n1 == 2)
		cout<< "The magnitude of the vector is: "<< v1 -> GetMagnitude(vector1, 2) <<endl;
	if(n1 == 3)
		cout<< "The magnitude of the vector is: "<< v1 -> GetMagnitude(vector1, 3) <<endl;
	*/


	/* Read the second Vector
	*/
	/*
	Vectors::MyVectors *v2 = new Vectors::MyVectors();
	vector2 = v2 -> ReadVector();
	int n2 = v2 -> GetNumber();
	cout<<"Vector: ";
	for(int i = 0; i < n2; i++)
	{
		cout<<vector2[i]<<" ";
	} 
	cout<<endl;
	cout<<endl;
	*/


	//Vectors::MyVectors *v3 = new Vectors::MyVectors();	
	/* Dot Product of two vectors
	*/
	/*
	if(n1 == n2)
		cout<<"The dot product(scalar) is: "<< v3 -> DotProduct(vector1,vector2,n1) << endl;
	*/


	/* Cross Product of two vectors
	*/
	/*
	if((n1 == 3) && (n2 == 3))
	{
		vector3 = v3 -> CrossProduct(vector1, vector2);
		cout<<"The cross product is: ";
		for(int i = 0; i < 3; i++)
			cout<< vector3[i]<<" ";
		cout<<endl;
	}
	*/



	////////////////////////////////////////////////////////////////////////////////
	//MATRIX TEST
	////////////////////////////////////////////////////////////////////////////////

	Matrices::MyMatrices *a = new Matrices::MyMatrices();
	////////////////
	/* First matrix
	*/
	
	//Matrices::MyMatrices *a = new Matrices::MyMatrices();
	//a -> ReadMatrix();
	//r1 = a -> GetRow();
	//c1 = a -> GetColumn();
	//matrix1 = a->GetMatrix();
	//float e[16];
	//e = a->GetMatrixGL();
	//a -> PrintMatrix(matrix1, r1, c1);
	//memcpy(e, a->GetMatrixGL(), sizeof(e));
	//a -> ReadMatrix();


	////////////////////
	/* Access rows and columns as vectors
	*/
	/*
	vector = a -> AccessMatrix(r1, c1, -1, 2, matrix1);
	*/


	/////////////////
	/* Second matrix
	*/
	/*
	Matrices::MyMatrices *b = new Matrices::MyMatrices();
	b -> ReadMatrix();
	r2 = b -> GetRow();
	c2 = b -> GetColumn();
	matrix2 = b->GetMatrix();
	b -> PrintMatrix(matrix2, r2, c2);	
	*/

	////////////////////////////////
	/* Third matrix for manipulation
	*/
	/*
	Matrices::MyMatrices *c = new Matrices::MyMatrices();
	matrix3 = c -> ShearMatrix(0,50);
	c -> PrintMatrix(matrix3,4,4);
	c->freeMatrix();
	c -> ReadMatrix();
	*/
	////////////////////
	/* Rotate Matrix
	*/
	/*
	matrix3 = c -> RotateMatrix(0,30);
	c -> PrintMatrix(matrix3,4,4);
	*/

	////////////////////
	/* Scale Matrix
	*/
	/*
	matrix3 = c -> ScaleMatrix(6,7,8);
	c -> PrintMatrix(matrix3,4,4);
	*/


	////////////////////
	/* Translate Matrix
	*/
	/*
	matrix3 = c -> TranslateMatrix(1,2,3);
	c -> PrintMatrix(matrix3,4,4);
	*/


	////////////////////
	/* Inverse Matrix
	*/
	/*
	if(r1 == c1){
		c -> InverseMatrix(matrix1, r1);
		matrix3 = c -> GetMatrix();
		cout<<"The Inversion of Matrix: "<<endl;
		c -> PrintMatrix(matrix3, r1, r1);
	}
	else
	{
		cout<<"Inverse Failed: Should be a Square!"<<endl;
	}
	*/


	/////////////////////////
	/* Transpose matrix
	*/
	/*
	c -> TransposeMatrix(matrix1, r1,c1);
	matrix3 = c->GetMatrix();
	cout<<"The Transpose of Matrix: "<<endl;
	c -> PrintMatrix(matrix3,c1, r1);
	*/


	///////////////////////////////////
	/* Multiplication of two matrices
	*/
	/*
	if(c1 == r2)
	{	
		r3 = r1;
		c3 = c2; 
		c -> MultiplyMatrix(matrix1, matrix2, r3, c3, c1);
		matrix3 = c->GetMatrix();
		cout<<"The Multiplication of Matrices: "<<endl;
		c -> PrintMatrix(matrix3, r3, c3);
	}
	else
	{
		cout<<"Number of columns in Matrix 1 is not equal to Number of rows in Matrix 2 :( "<<endl;
		cout<<"Multiplication Failed!"<<endl;
	}
	*/


	return 0;
}
